package com.springboot.mail.modules.User.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseService;
import com.springboot.mail.common.bean.DeleteDTO;
import com.springboot.mail.common.bean.MyResult;
import com.springboot.mail.common.bean.PageQueryDTO;
import com.springboot.mail.modules.User.domain.entity.UserDO;
import com.springboot.mail.modules.User.domain.vo.ResponseLoginVO;
import com.springboot.mail.modules.User.domain.vo.UserVO;

import java.util.List;

public interface UserService extends MPJBaseService<UserDO> {


    MyResult<Page<UserVO>> getInfoPageBy(PageQueryDTO pageQueryDTO, UserVO userVO);

    MyResult<String> rePassword(String id);

    MyResult<String> setStatus(String id);

    MyResult<String> deleteInfo(String id);




    // 注册用户
    MyResult<Boolean> registerUser(UserVO user);

    // 用户登录验证
    MyResult<ResponseLoginVO> loginUser(String username, String password);

    MyResult<String> logout();


    MyResult<String> addUserInfo(UserVO userVO);
    MyResult<String> delUserInfo(String userId);
    MyResult<String> delUserInfo(DeleteDTO<String> deleteIds);


    MyResult<UserVO> getUserById(String userId);

    MyResult<UserVO> getUserByUsername(String username);

    MyResult<List<UserVO>> getTeacherList();

    MyResult<IPage<UserVO>> getStudentInfoPageBy(PageQueryDTO pageQueryDTO, UserVO userVO);



    MyResult<String> changeUserInfo(UserVO userVO);

    MyResult<String> changeName(String userId, String name);

    // 修改密码
    MyResult<String> changePassword(String userId, String oldPassword, String newPassword);

    // 修改电子邮箱
    MyResult<String> changeEmail(String userId, String oldEmail, String newEmail);

    // 修改手机号
    MyResult<String> changePhone(String userId, String newPhone);

    MyResult<String> changeAvatarUrl(String userId, String avatarUrl);

}